﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using XXX.Models.XXXEntities;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace XXX.api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class U8XieTongController : ControllerBase
    {
        private readonly IU8XieTongRepository _invRepository;
        private readonly ILogger<U8XieTongController> _logger;
        public U8XieTongController(IU8XieTongRepository xxxRepository, ILogger<U8XieTongController> logger)
        {
            _invRepository = xxxRepository;
            _logger = logger;
        }

        // GET: api/<DepartMentController>
        [HttpGet]
        public string Get()
        {

            //DataTable dt = new DataTable();

            ////HttpResponseMessage httpReponseMessage = new HttpResponseMessage();
            //string jsonstr = JsonConvert.SerializeObject(dt);
            ////httpReponseMessage.Content = new StringContent(jsonstr);
            return "";
            //return ReturnStd.Success(jsonstr);
        }

        [HttpPost]
        public Models.RetModel Post(Models.XXXEntities.U8XieTong model)
        {
             
                Models.RetModel ret = _invRepository.AddU8XieTong(model);
                return ret;
           
        }


    }
}
